package com.blog.blog.mapper;

import com.blog.blog.vo.RoleVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    List<RoleVO> listRoles(String keyword);

    int insertRole(com.blog.blog.dto.SaveRoleDTO dto);
    int updateRole(@Param("id") Long id, @Param("dto") com.blog.blog.dto.SaveRoleDTO dto);
    int deleteRole(Long id);

    int deleteRolePerms(Long roleId);
    int insertRolePerm(@Param("roleId") Long roleId, @Param("permId") Long permId);

    java.util.List<Long> selectPermIdsByRoleId(Long roleId);

    // 根据用户ID查询其角色的数据范围集合（ALL/SELF）
    java.util.List<String> selectRoleDataScopesByUserId(Long userId);
}


